package com.deram.ctin.serv.enter.api;

import com.deram.ctin.common.bean.PageResult;
import com.deram.ctin.serv.enter.entity.BaseUpdateInfo;
import com.deram.ctin.serv.enter.entity.EnterInfo;
import com.deram.ctin.serv.enter.filter.EnterInfoFilter;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: jtt
 * @Description:
 * @Date: 2017/9/12 10:17
 * @version: V1.0
 */
@FeignClient("serv-enter")
@RequestMapping("/enterInfoApi")
public interface EnterInfoApi {

    @PostMapping("/find")
    EnterInfo findById(@RequestParam("id") Long enterId);

    @PostMapping("/searchByKeywords")
    List<EnterInfo> searchByKeywords(@RequestParam("keywords") String keywords);

    @PostMapping("/searchByFather")
    List<EnterInfo> searchByFather(@RequestParam("fatherId") Long fatherId);

    @PostMapping("/list")
    List<EnterInfo> list(@RequestBody EnterInfoFilter filter);

    @PostMapping("/search")
    PageResult<EnterInfo> search(@RequestBody EnterInfoFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize);

    @PostMapping("/save")
    EnterInfo save(@RequestBody EnterInfo param);

    @PostMapping("/insertList")
    void insertList(@RequestBody BaseUpdateInfo<EnterInfo> param);

    @PostMapping("/delete")
    void delete(@RequestParam("id") Long id);

    @PostMapping("/findAll")
    List<EnterInfo> findAll();
}
